.PHONY:clean all
targets=smartcommunity
sources=main.cpp NetworkManager.cpp wrap.cpp DatabaseManager.cpp RequestHandler.cpp
objects=main.o NetworkManager.o wrap.o DatabaseManager.o RequestHandler.o

LIBPATH=-I/usr/include/jsoncpp
$(targets):$(objects)
	@gcc $(objects) -o $@ -L . -lstdc++ -lsqlite3 -ljsoncpp -lthread-pool -lpthread
%.o:%.cpp
	@g++  -c $< -o $@  $(LIBPATH)
clean:
	@rm -f *.o smartcommunity
thread-pool.so:
	gcc -fpic -shared thread-pool.c linkqueue.c -o libthread-pool.so -lpthread